package com.ruoyi.common.core.utils.uuid;

import java.util.Random;

/**
 * @Description: 生成随机数
 * @Author: j.zh
 * @Date: 2024/5/2
 * @Version: 4.0.0
 **/
public class RandomUtils {

    /**
     * @Description: 按长度生成随机数
     * @Author: j.zh
     * @Date: 2024/5/2
     * @param length
     * @return java.lang.String
     * @Version: 4.0.0
    **/
    public static String generateRandomNumber(Integer length) {
        Long random = new Random().nextLong();
        return random.toString().substring(2, (length.intValue()+2));
    }
}
